package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-05-25
 * Time: 15:16
 */
public class BookList {//书架
    private Book[] books = new Book[10];//在一个类中，一另外一个类的实例作为自己的成员，叫做组合
    private int useSize;


    public BookList() {
        books[0] = new Book("三国演义","罗贯中",44,"小说");
        books[1] = new Book("红楼梦","曹雪芹",67,"小说");
        books[2] = new Book("西游记","吴承恩",44,"小说");

        useSize = 3;
    }

    public Book getBook(int pos) {
        return books[pos];
    }

    public void setBook(int pos, Book book) {
        this.books[pos] = book;
    }

    public int getUseSize() {
        return useSize;
    }

    public void setUseSize(int useSize) {
        this.useSize = useSize;
    }

    public int getBooksLength(){
        return books.length;
    }
}
